package com.haidechizi.mybatis.demo.jdbc;

import com.haidechizi.mybatis.demo.entity.User;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import org.springframework.jdbc.core.JdbcTemplate;

import java.util.List;

public class SpringJdbcDemo {

    public static void main(String[] args) {
        ClassPathXmlApplicationContext context =
                new ClassPathXmlApplicationContext("classpath:spring-jdbc.xml");
        JdbcTemplate jdbcTemplate = context.getBean(JdbcTemplate.class);
        List<User> query = jdbcTemplate.query("select * from user where id = ?", new User(), 1L);

        System.out.println(query);
    }
}
